package com.core.supplier;

import com.core.dto.GoodDTO;

import java.util.function.Supplier;
import java.util.stream.IntStream;

/**
 * Created with IntelliJ IDEA.
 * User: lxf
 * Date: 2016/11/18
 * Time: 14:32
 * To change this template use Editor | File and Code Templates.
 */
public class GoodSupplier implements Supplier<GoodDTO> {

    private String name;
    private int age;

    @Override
    public GoodDTO get() {
        return new GoodDTO("zxc", "zbc", IntStream.generate(() -> (int) (System.nanoTime() % 80)).limit(1).reduce(0, Integer::sum) + "");
    }

    public GoodSupplier() {
    }

    public GoodSupplier(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
